package com.heima.media.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.LoginDto;
import com.heima.media.service.IWmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@Api(tags = "自媒体用户登录接口")
public class LoginController {
    @Autowired
    private IWmUserService userService;

    /**
     * 自媒体账户登录
     * @param dto
     * @return
     */
    @ApiOperation(value = "用户登录" , notes = "author:lqw")
    @ApiImplicitParam(name = "dto" ,value = "登录对象" ,required = true ,dataType = "LoginDto")
    @PostMapping("/in")
    public ResponseResult login(@RequestBody LoginDto dto){
       return userService.login(dto);
    }
}
